package com.sunmnet.j2ee.entity.powerdb.designer;

import com.sunmnet.j2ee.entity.base.OnlyAutoIdEntity;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.search.annotations.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


@javax.persistence.Entity
@Table(name = "pdm_oper_record")
@DynamicInsert(true)
@DynamicUpdate(true)
public class OperRecord extends OnlyAutoIdEntity implements Serializable {


    private static final long serialVersionUID = 5905499878705248429L;

    private Date createTime;
    private short type;
    private String record;
    private int accountId;
    private String operationSql;
    private String result;
    private short jobStatus;
    private Long projectId;
    private Long moduleId;

    @Override
    public String toString() {
        return new ReflectionToStringBuilder(
                this,
                ToStringStyle.DEFAULT_STYLE)
                .toString();
    }

    @org.hibernate.search.annotations.Field(store = Store.YES, index = org.hibernate.search.annotations.Index.UN_TOKENIZED)
    @DateBridge(resolution = Resolution.SECOND)
    @Column(nullable = true, updatable = false)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "type")
    public short getType() {
        return type;
    }

    public void setType(short type) {
        this.type = type;
    }
    @Column(name = "record")
    public String getRecord() {
        return record;
    }

    public void setRecord(String record) {
        this.record = record;
    }
    @Column(name = "account_id")
    public int getAccountId() {
        return accountId;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }
    @Column(name = "operation_sql")
    public String getOperationSql() {
        return operationSql;
    }

    public void setOperationSql(String operationSql) {
        this.operationSql = operationSql;
    }
    @Column(name = "result")
    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }
    @Column(name = "job_status")
    public short getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(short jobStatus) {
        this.jobStatus = jobStatus;
    }
    @Column(name = "module_id")
    public Long getModuleId() {
        return moduleId;
    }

    public void setModuleId(Long moduleId) {
        this.moduleId = moduleId;
    }
    @Column(name = "project_id")
    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }
}
